#include "soaGetFileDirRpc.h"

#include "public_define.h"
#include "adr_component.h"

#include "Basc_getFileDirRPC.pb.h"

using namespace DcAdr;

SoaGetFileDirRpc::SoaGetFileDirRpc()
{

}

SoaGetFileDirRpc::~SoaGetFileDirRpc()
{

}

SoaGetFileDirRpc &SoaGetFileDirRpc::getInstance()
{
    static SoaGetFileDirRpc info;
    return info;
}

void SoaGetFileDirRpc::setPublishHandle(adr_component *component)
{
    m_component = component;
}

void SoaGetFileDirRpc::transFileDir(const std::string &topic, const std::string &requestData, std::string &replyData)
{
    Log_Info("[SoaGetFileDirRpc] [transFileDir]");
    Soa::PB_Basc_getFileDirRPC_transFileDir_In getFileDirRpc;
    if (!getFileDirRpc.ParsePartialFromString(requestData))
    {
        Log_ERROR("SoaQueryFilePathInfo parse proto data failed , topic: {}", topic);
    }

    std::string eventType = getFileDirRpc.eventtype();

    Soa::PB_Basc_getFileDirRPC_transFileDir_Out getFileDirRpcOut;

    getFileDirRpcOut.set_return_("/ds/datacollect/2022-08-03_20-28-29_BA500.dat");
    getFileDirRpcOut.SerializePartialToString(&replyData);

    return;
}

